-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(web): Add session management UI for viewing and disconnecting active streams #4582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat(web): Add session management UI for viewing and disconnecting active streams #4582
Conversation
- Add /sessions page with table showing client name, IP address, and duration - Add /api/sessions endpoint to list active streaming sessions - Add /api/sessions/disconnect endpoint to terminate sessions - Include auto-refresh (5s) and manual refresh options - Add confirmation dialog before disconnecting - Add Sessions link to navigation bar Co-Authored-By: Claude Opus 4.5 <[email protected]>
The disconnect confirmation modal was failing with "bootstrap is not defined" because the Modal class wasn't being imported. Now imports Modal from bootstrap/dist/js/bootstrap, matching the pattern used in apps.html. Co-Authored-By: Claude Opus 4.5 <[email protected]>
…lookup Previously, add_authorized_client() generated a random UUID for each paired client, while the Moonlight client sends its own uniqueid during launch. This caused the session management UI to show random UUIDs instead of friendly device names, since the lookup would never match. Now stores the client's actual uniqueID when pairing completes, so session lookups can properly match and display the friendly name from the paired clients database. Note: Existing paired clients will need to re-pair to get correct name mapping. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Adjust inline comment spacing to conform to project's clang-format configuration. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add comprehensive documentation comments to get_all_sessions() and disconnect() functions explaining their purpose, parameters, and return values. Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
the branch is working great on my windows machine with nvidia card. Able to see the active sessions by name/ipaddress and terminate them successfully. |
|
Thank you, we will review it. Would you mind updating the PR to use our template though? https://github.com/LizardByte/.github/blob/master/.github/pull_request_template.md?plain=1 |
|
I updated the readme to match your PR template |
Previously, if a temporary error occurred during session fetch (e.g., during the brief transition after disconnecting a client), the error message would persist even after subsequent successful fetches because the success path never cleared the errorMessage state. Now clears errorMessage when fetch succeeds, so transient errors don't persist on the UI. Co-Authored-By: Claude Opus 4.5 <[email protected]>
|




Description
This PR adds a new Sessions page to the Sunshine web UI that allows administrators to view and manage active streaming sessions.
Features:
Implementation Details:
Backend (C++):
session::get_all_sessions()function instream.cppto enumerate active sessions thread-safelysession::disconnect()function to terminate sessions by IDGET /api/sessionsendpoint to retrieve session list as JSONPOST /api/sessions/disconnectendpoint to terminate a sessionFrontend (Vue.js):
sessions.htmlpage following existing UI patternsFiles Changed:
src/stream.h- Addedsession_info_tstruct and function declarationssrc/stream.cpp- Implemented session enumeration and disconnect functionssrc/confighttp.cpp- Added API endpoints and page routesrc/nvhttp.cpp- Fixed to store client's uniqueID during pairingsrc_assets/common/assets/web/sessions.html- New sessions pagesrc_assets/common/assets/web/Navbar.vue- Added Sessions link to navigationsrc_assets/common/assets/web/public/assets/locale/en.json- Added translationsvite.config.js- Added sessions.html to build inputsScreenshot
Empty state (no active sessions):
[Screenshot: Sessions page showing "No active streaming sessions" message]
With active session:

[Screenshot: Sessions page showing client "yoga" connected from 10.0.0.2 with Disconnect button]
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage
Notes:
sync_util::sync_tpatterns